﻿using System;

// 员工类
class Employee
{
    // 成员变量
    private string name;
    private int age;
    private string department;
    private double salary;

    // 无参构造方法
    public Employee() { }

    // 带参构造方法
    public Employee(string name, int age, string department, double salary)
    {
        this.name = name;
        this.age = age;
        this.department = department;
        this.salary = salary;
    }

    // get/set方法
    public string Name { get => name; set => name = value; }
    public int Age { get => age; set => age = value; }
    public string Department { get => department; set => department = value; }
    public double Salary { get => salary; set => salary = value; }

    // 显示所有成员信息的方法
    public void ShowInfo()
    {
        Console.WriteLine($"姓名：{name}，年龄：{age}，部门：{department}，薪资：{salary}");
    }
}

// 测试类
class Program
{
    static void Main(string[] args)
    {
        // 测试无参构造+set方法
        Employee emp1 = new Employee();
        emp1.Name = "张三";
        emp1.Age = 25;
        emp1.Department = "研发部";
        emp1.Salary = 8000;
        emp1.ShowInfo();

        // 测试带参构造
        Employee emp2 = new Employee("李四", 30, "市场部", 10000);
        emp2.ShowInfo();
    }
}